From: Mischa POSLAWSKY Date: Fri, 6 Mar 2015 06:07:06 +0000 (+0100) Subject: font: navigation links to offset character table X-Git-Tag: v1.7~44 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/bfb80ffa567c24ad151eaad7c0e813eb1f6cbe76?q=%25d font: navigation links to offset character table --- diff --git a/font.plp b/font.plp index e0a9663..2af6133 100644 --- a/font.plp +++ b/font.plp @@ -17,6 +17,8 @@ if (my $font = $ENV{PATH_INFO} =~ s{^/}{}r) { $fontmeta or die "Unknown font $font\n"; my $offset = $get{q} || 0; + $offset < 0 and $offset = 0; + my $size = 0x200; say "

Font coverage

"; say "

$_

" for EscapeHTML($fontmeta->{name}); @@ -47,7 +49,19 @@ if (my $font = $ENV{PATH_INFO} =~ s{^/}{}r) { EOT say ''; - for my $cp ($offset .. $offset+0x1FF) { + say "" for join(' ', grep {$_} + $offset > $size && sprintf('◄', 0), + $offset > 0 && sprintf( + '', + $offset - $size, + ), + sprintf('U+%04X', $offset), #TODO: block name + $offset + $size < 0x11_0000 && sprintf( + '', + $offset + $size, + ), + ); + for my $cp ($offset .. $offset+$size-1) { my $info = $glyphs->glyph_info($cp); my ($class, $name, $mnem, $html, $string) = @{$info}; my $np = $class =~ /\bC\S\b/; # noprint if control or invalid
$_